package com.szeldon.utils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * Utility class for file operations.
 * 
 * @author szeldon
 * 
 */
public final class FileUtils {

    /**
     * Reads content of file with given filename.
     * 
     * @param filename
     * @return
     * @throws IOException
     *             Thrown when there was some IO error during reading.
     */
    public static String readFileContent(String filename) throws IOException {

        StringBuffer buffer = new StringBuffer();
        BufferedReader reader = new BufferedReader(new FileReader(filename));
        String line = null;
        while ((line = reader.readLine()) != null) {
            buffer.append(line + "\n");
        }
        reader.close();
        return buffer.toString();
        
        
    }

}
